        
log using "OSS_mobil_replication.log", replace
/* Replication of analyses in Journal of Economic History article "Technology and the Era of the Mass Army" */
/* By Massimiliano Onorato, Ken Scheve, David Stasavage*/
/* November 2013 */

# delimit;clear;
use "OSS_mobil_repl_data.dta", clear;
set mat 1000;
sort countryno year;
xtset countryno year;

/***************
Replication of analyses reported in the article
*****************/

/***************
Replication of Table 1
*****************/
summarize mobil military1 if year>=1600 & year<1700 & waryear==1;
summarize mobil military1 if year>=1700 & year<1800 & waryear==1;
summarize mobil military1 if year>=1800 & year<1900 & waryear==1;
summarize mobil military1 if year>=1900 & year<=2000 & waryear==1;

/***************
Replication of Table 2
*****************/

xtreg military1  gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/***************
Replication of Table 3
*****************/

xtreg mobil  gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/***************
Replication of Table 4
*****************/  

clear;
use OSS_mobil_repl_data_lrgesmple.dta, replace;
xtset uniqueccode year;

xtreg milper raillineip pctivliteracyip tpop rgdppcip democracy year if waryear==1, fe cluster(uniqueccode);
xtreg milper raillineip pctivliteracyip tpop rgdppcip democracy cd1-cd100 if waryear==1, fe cluster(uniqueccode);
xtreg mobilization raillineip pctivliteracyip tpop rgdppcip democracy year if waryear==1, fe cluster(uniqueccode);
xtreg mobilization raillineip pctivliteracyip tpop rgdppcip democracy cd1-cd100 if waryear==1, fe cluster(uniqueccode);
clear;

/*************** 
*Figure 1
****************/
use "OSS_mobil_repl_data.dta", clear;
sort countryno year;
xtset countryno year;

twoway (connected military1 year if country=="France", yaxis(1) ytitle("Military Size, Thousands",axis(1)) msymbol(O) ylabel(0(1000)5000)) (connected mobil year if country=="France", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh) ylabel(0(.05).40,axis(2))), xtitle(Year) title(Military Mobilization in France) graphregion(fcolor(white)) xline(1693) text(3000 1693 "Nine Years'", place(c)) text(2600 1693 "War", place(c)) xline(1747) text(5000 1747 "War of Austrian", place(c)) text(4600 1747 "Succession", place(c)) xline(1794) text(1900 1794 "Revolutionary", place(c)) text(1500 1794 "Wars", place(c))  xline(1812) text(3500 1812 "Napoleonic", place(c)) text(3100 1812 "Wars", place(c)) xline(1871) text(2600 1871 "Franco-Prussian", place(c)) text(2200 1871 "War",place(c)) xline(1918) text(4000 1918 "WWI",place(c)) xline(1940) text(3000 1940 "WWII",place(c)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization"));
graph save Figure1,replace;

/***************
Replication of Analyses Reported in text in the article
*****************/

/** Rerun key specifications with gt1957 as alternative to gt1970 **/
xtreg military1 gt1789 gt1859 gt1957 if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib gt1789 gt1859 gt1957 if waryear==1, fe cluster(countryno);

xtreg mobil gt1789 gt1859 gt1957 if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib gt1789 gt1859 gt1957 if waryear==1, fe cluster(countryno);

/** Rerun key specifications with gt1793 as alternative to gt1789 **/
gen gt1793=0;
replace gt1793=1 if year>=1793;
xtreg military1 gt1793 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib gt1793 gt1859 gt1970 if waryear==1, fe cluster(countryno);

xtreg mobil gt1793 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib gt1793 gt1859 gt1970 if waryear==1, fe cluster(countryno);

/**Table 2 NO CLUSTER**/
xi: reg military1  gt1789 gt1859 gt1970 i.countryno if waryear==1, robust;
xi: reg military1 RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 i.countryno if waryear==1, robust;
xi: reg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year i.countryno if waryear==1, robust;
xi: reg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend i.countryno if waryear==1, robust;

/**Table 3 NO CLUSTER**/
xi: reg mobil  gt1789 gt1859 gt1970 i.countryno if waryear==1, robust;
xi: reg mobil RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 i.countryno if waryear==1, robust;
xi: reg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy year i.countryno if waryear==1, robust;
xi: reg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend i.countryno if waryear==1, robust;

/** Use RR measure normalized by area **/
xtreg military1 RRkmip_area firstcruise_lib gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip_area firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip_area firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip_area firstcruise_lib gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip_area firstcruise_lib popul2 gdppcip2 literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip_area firstcruise_lib popul2 gdppcip2 literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/** Rerun Table 2 and 3 with nuclear cap**/
xtreg military1 RRkmip1 nuclearcap gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 nuclearcap popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 nuclearcap popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 nuclearcap gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 nuclearcap popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 nuclearcap popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/** Rerun Table 2 and 3 with estwarheads **/
xtreg military1 RRkmip1 estwarheads gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 estwarheads popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 estwarheads popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 estwarheads gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 estwarheads popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 estwarheads popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/** Rerun Table 2 and 3 with census as alternative measure of fiscal capacity**/
xtreg military1 RRkmip1 firstcruise_lib popul1 census literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 census literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul2 census literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul2 census literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/** Use alternative measures of democracy **/
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt taxes year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt taxes austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt taxes year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt taxes austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt spending year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt spending austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt spending year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt spending austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/* Nationalism and RR interaction */

xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt litxRR democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt litxRR democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt litxRR democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt litxRR democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/* Ngram measure of Nationalism  */

corr military1 ngramnation2 if waryear==1 & country=="France";
corr military1 ngramnation2 if waryear==1 & country=="Prussia/Germany";
corr military1 ngramnation2 if waryear==1 & country=="United Kingdom";
corr mobil ngramnation2 if waryear==1 & country=="France";
corr mobil ngramnation2 if waryear==1 & country=="Prussia/Germany";
corr mobil ngramnation2 if waryear==1 & country=="United Kingdom";

xtreg military1 RRkmip1 firstcruise_lib popul2 gdppcip2 ngramnation2 democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul2 gdppcip2 ngramnation2 democracy francetrend germanytrend if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 ngramnation2 democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 ngramnation2 democracy francetrend germanytrend if waryear==1, fe cluster(countryno);

/* Democracy and RR interaction */

xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt demxRR democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt demxRR democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt demxRR democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt demxRR democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/** Rerun Table 2 in log levels **/
xtreg lnmilitary1 RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg lnmilitary1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg lnmilitary1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/** Table 2 and 3 with year fixed effects **/
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy i.year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy i.year if waryear==1, fe cluster(countryno);

/** Table 2 and 3 with control for telegrams **/
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy telegramip year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy telegramip austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy telegramip year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy telegramip austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/** Table 2 and 3 with control for steam and motor ships **/
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy ship_steammotorip year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy ship_steammotorip austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy ship_steammotorip year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy ship_steammotorip austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/** Rerun Table 2 and 3 without observations with large foreign soldiers**/

xtreg military1 RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 if waryear==1 & samplesel==0, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & samplesel==0, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & samplesel==0, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 if waryear==1 & samplesel==0, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & samplesel==0, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & samplesel==0, fe cluster(countryno);

/** Rerun Table 2 and 3 dropping Russia and/or Prussia/Germany **/
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="Russia/Soviet Union", fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="Russia/Soviet Union", fe cluster(countryno);

xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="Prussia/Germany", fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="Prussia/Germany", fe cluster(countryno);

xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="Russia/Soviet Union" & country~="Prussia/Germany", fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="Russia/Soviet Union" & country~="Prussia/Germany", fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="Russia/Soviet Union", fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="Russia/Soviet Union", fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="Prussia/Germany", fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="Prussia/Germany", fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="Russia/Soviet Union" & country~="Prussia/Germany", fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="Russia/Soviet Union" & country~="Prussia/Germany", fe cluster(countryno);

/** Rerun Table 2 and 3 dropping France and dropping France, Russia, and Prussi/Germany**/
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="France", fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="France", fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="France", fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="France", fe cluster(countryno);

xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="Russia/Soviet Union" & country~="Prussia/Germany" & country~="France", fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="Russia/Soviet Union" & country~="Prussia/Germany" & country~="France", fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1 & country~="Russia/Soviet Union" & country~="Prussia/Germany" & country~="France", fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1 & country~="Russia/Soviet Union" & country~="Prussia/Germany" & country~="France", fe cluster(countryno);


/** Rerun Table 2 and 3 without WWI **/
preserve;
drop if year>=1914 & year<=1918;
xtreg military1 RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

restore;

/** Rerun Table 2 and 3 without WWI & WWII **/
preserve;
drop if (year>=1914 & year<=1918) | (year>=1939 & year<=1945);
xtreg military1 RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg military1 RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

xtreg mobil RRkmip1 firstcruise_lib gt1789 gt1859 gt1970 if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg mobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

restore;

/* Rerun Table 2 and 3 with control for Neighborhood Mobilization */
use "OSS_mobil_repl_data.dta", clear;
sort countryno year;
xtset countryno year;

xtreg military1 neighmil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg military1 neighmil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);
xtreg mobil neighmobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg mobil neighmobil RRkmip1 firstcruise_lib popul1 gdppcip literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

/***************
Replication of Analyses in Online Appendix
*****************/

/******
* Figures A-1 and A-2
*******/

twoway (connected military1 year if country=="AustriaHungary", yaxis(1) yscale(r(0 15000) axis(1)) ytitle("Military Size, Thousands",axis(1)) msymbol(O)) (connected mobil year if country=="AustriaHungary", yaxis(2) yscale(r(0 0.2) axis(2)) ytitle("Mobilization",axis(2)) msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in Austria Hungary) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel1,replace;more;
twoway (connected military1 year if country=="China", yaxis(1) ytitle("Military Size, Thousands",axis(1)) msymbol(O)) (connected mobil year if country=="China", yaxis(2) ytitle("Mobilization",axis(2)) msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in China) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel2,replace;more;
twoway (connected military1 year if country=="France", yaxis(1) ytitle("Military Size, Thousands",axis(1)) msymbol(O)) (connected mobil year if country=="France", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in France) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel3,replace;more;
twoway (connected military1 year if country=="Italy", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="Italy", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in Italy) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel4,replace;more;
twoway (connected military1 year if country=="Japan", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="Japan", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in Japan) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel5,replace;more;
twoway (connected military1 year if country=="Netherlands", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="Netherlands", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in Netherlands) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel6,replace;more;
graph combine mobpanel1.gph mobpanel2.gph mobpanel3.gph mobpanel4.gph mobpanel5.gph mobpanel6.gph,  col(2) ycommon graphregion(fcolor(white) )  altshrink title("Mobilization in Great Powers, 1600-2000") subtitle("Military Size and Mobilization Rates") xsize(6.5) ysize(8.5);
graph save FigureA1,replace;

twoway (connected military1 year if country=="Ottoman", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="Ottoman", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in Ottoman Empire) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel13,replace;more;
twoway (connected military1 year if country=="Prussia/Germany", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="Prussia/Germany", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in Prussia/Germany) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel7,replace;more;
twoway (connected military1 year if country=="Russia/Soviet Union", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="Russia/Soviet Union", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in Russia/Soviet Union) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel8,replace;more;
twoway (connected military1 year if country=="Spain", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="Spain", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in Spain) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel9,replace;more;
twoway (connected military1 year if country=="Sweden", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="Sweden", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in Sweden) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel10,replace;more;
twoway (connected military1 year if country=="United Kingdom", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="United Kingdom", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in United Kingdom) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel11,replace;more;
twoway (connected military1 year if country=="USA", yaxis(1) ytitle("Military Size, Thousands",axis(1))msymbol(O)) (connected mobil year if country=="USA", yaxis(2) ytitle("Mobilization",axis(2))msymbol(Dh)), xscale(r(1600 2000)) xlabel(1600(100)2000) xtitle(Year) title(Military Mobilization in United States) graphregion(fcolor(white)) legend( order(1 2) lab(1 "Military Size") lab(2 "Military Mobilization")); graph save mobpanel12,replace;more;
graph combine mobpanel13.gph mobpanel7.gph mobpanel8.gph mobpanel9.gph mobpanel10.gph mobpanel11.gph mobpanel12.gph,  col(2) ycommon graphregion(fcolor(white) )  altshrink title("Mobilization in Great Powers, 1600-2000") subtitle("Military Size and Mobilization Rates") xsize(6.5) ysize(8.5);
graph save FigureA2,replace;

/******
* Table A-2
*******/
xtreg conscription RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg universal RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy year if waryear==1, fe cluster(countryno);
xtreg conscription RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);
xtreg universal RRkmip1 firstcruise_lib popul2 gdppcip2 literacy_qrt democracy austriahungarytrend chinatrend francetrend italytrend japantrend netherlandstrend germanytrend russiatrend spaintrend swedentrend usatrend uktrend ottotrend if waryear==1, fe cluster(countryno);

log close;

